AN1 Reader: Trust URL encoded in new format over old encoding.
authorrobertl <robertl>
Tue, 22 Aug 2006 17:35:26 +0000 (17:35 +0000)
committerrobertl <robertl>
Tue, 22 Aug 2006 17:35:26 +0000 (17:35 +0000)
an1.c

diff --git a/an1.c b/an1.c
index e86ed61b4cfaadf094af7ad91d8549f6ed125eb8..cc15fe0fc82b89aacc97a3223e75ca9b43655558 100644 (file)
--- a/an1.c
+++ b/an1.c
@@ -415,6 +415,12 @@ static void Read_AN1_Waypoint( FILE *f, an1_waypoint_record *wpt ) {
                ofs += 2;
 
                if ( len ) {
+                       /*
+                        * Trust URL encoded in new format over one in
+                        * old format.  Whack the name starting at '{URL='.
+                        */
+                       wpt->name[strlen(wpt->name) - len - 6] = 0;
+
                        wpt->url = xcalloc( len+1, 1 );
                        memcpy( wpt->url, ofs, len );
                        ofs += len;